Currently, a battery in an electronic device is charged through a power adapter of the electronic device. A constant-voltage output is usually used by the power adapter for charging the battery. However, for a battery with large capacity, it will result in too long charging time by charging the battery with the constant-voltage output, and above mentioned charging way cannot realize quick charging for the battery and thus cannot shorten the charging time.